package com.heima.admin.controller.v1;

import com.heima.admin.service.AdNewsAuthService;
import com.heima.model.common.dtos.PageRequestDto;
import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.AdWmNewsDto;
import com.heima.model.wemedia.dtos.NewsAuthDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/news")
@Slf4j
public class AdNewsAuthController {

    @Autowired
    private AdNewsAuthService adNewsAuthService;

    /**
     * 查询要审核文章的列表
     *
     * @param dto
     * @return
     */
    @PostMapping("/list_vo")
    public ResponseResult list_vo(@RequestBody AdWmNewsDto dto){

        log.info("接收到的参数-------{}",dto);

        return adNewsAuthService.list_vo(dto);
    }
    @PostMapping("/auth_fail")
    public ResponseResult authFail(@RequestBody NewsAuthDto dto){
        return adNewsAuthService.authFail(dto);
    }
    @PostMapping("/auth_pass")
    public ResponseResult authPass(@RequestBody NewsAuthDto dto){
        return adNewsAuthService.authPass(dto);
    }


    /**
     * 很久id查询文章详情
     * @param id
     * @return
     */
    @GetMapping("/one_vo/{id}")
    ResponseResult one_vo(@PathVariable("id") int id){
        log.info("接收到的参数-------{}",id);
        return adNewsAuthService.one_vo(id);
    }
}
